All Questions
7 questions
0votes
2answers
188views
How to refactor code so that a facade class could be decoratable?
I've got a class that is a facade class (encapsulates complex-ish behaviour for reusability). It has a function called manage (the class is called Manager): function manage() { $entityBuilder = '...
1vote
0answers
80views
Why does the PHP community always rely on file-based logging instead of a combination with in-memory logging?
This is an initial thought I'm having on logging. Clearly, am missing something about the whole picture because I don't think someone didn't think of this before. PHP runs on one request. That means ...
0votes
2answers
409views
Handling logging when there is no internet access
I'm developing an application that handles sales for multiple clients, when the client sells a particular item, that information should be send to the admin. The count of each item sold and the item ...
8votes
1answer
2kviews
Best way to access a logger across an application/website in PHP
I've recently read up on PSR-3 and am interested in learning about the best way(s) of approaching a logger implementation across a web application or website. I understand how a logger is defined and ...
1vote
3answers
2kviews
Exception when logging exception: is it correct to ignore them?
My question is specific to php, but i think it can be useful in other languages. I log into a table all the exception a code can throw: try{ //Some code } catch (Exception $e) { $log = new ...
0votes
1answer
120views
debugging web applications using debug parameter
A suggestion has been made by a team member to leave all debug code intact in our web pages... and then to create a variable that can be turned on / off to enable / disable debugging. This is a ...
14votes
2answers
4kviews
Is it more sensible to log exceptions in a catch-all or in a base exception class?
I'm in the process of refactoring a fairly large web app. One of the major issues is inconsistent error handling and I'm trying to come up with a sensible strategy. I've created a custom error ...